#ifndef ARGUMENTPARSER_H
#define ARGUMENTPARSER_H

#include "settings.h"

class ArgumentParser
{
public:
	enum FileType
	{
		Invalid,
		Widget,
		Directory,
		URL
	};

public:
	ArgumentParser(int argc, char *argv[]);
	~ArgumentParser();

    QString getFile() const;
    QString getPlatform() const;
    GeneratorTarget getTarget() const;
    ArgumentParser::FileType getFileType() const;
    bool guiEnabled() const;

private:
	enum ParameterType
	{
		ValidDirectory,
		ValidFile,
		Boolean,
		String,
		Option
	};

private:
	void parse(int argc, char *argv[]);
	bool checkSetting(QString setting, QString value);
	bool checkOption(QString option, QString value);

private:
	QMap<QString, Settings::Parameter> *m_settings;
	QMap<QString, ParameterType> *m_commandOptions;
	QMap<Settings::Parameter, ParameterType> *m_parameterTypes;
	QStringList *m_invalidArguments;

    GeneratorTarget m_target;
	FileType m_type;
	QString m_file;
    QString m_platform;
	bool m_gui;

};

#endif // ARGUMENTPARSER_H
